{template header}
<link href="{SITE_URL}public/bootstrap-datetimepicker/bootstrap-datetimepicker.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="{SITE_URL}public/bootstrap-datetimepicker/bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="{SITE_URL}public/bootstrap-datetimepicker/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
<script type="text/javascript" src="{SITE_URL}public/js/city/jquery.cityselect.js"></script>
<script type="text/javascript">
  var city1 = "{$strUser['province']}";
  if(city1==''){city1 = '北京';}
  var city2 = "{$strUser['city']}";
  if(city2==''){city2 = '朝阳区';}

  $(function(){
    $("#city_3").citySelect({
      prov:city1,
      city:city2
    });

  });
</script>
<div class="container">

<div class="row">

<div>

    <div class="panel panel-default">
        <div class="panel-body">

          <div class="page-header">
            <h1>{$title}</h1>
          </div>

<div style="height:30px;"></div>

<div class="row">

  <div class="col-md-1"></div>
  <div class="col-md-7">


<form role="form" method="POST" action="{tsUrl('my','setting',array('ts'=>'basedo'))}" id="form1" >

  <input type="hidden" name="groupid" value="{$groupid}">
  <input type="hidden" name="link" value="{$link}">
  <input type="hidden" id="jointype" name="jointype" value="{$jointype}">
  {if $jointype == 2}
  <input type="hidden" id="isvo" name="isvo" value="{$isvo}">
  <input type="hidden" name="donate" value="{$donate}">
  <input type="hidden" name="isdonate" value="{$isdonate}">
  {/if}
  <div class="form-group">
    <label>真实姓名<sup><i class="fa fa-asterisk" style="color:red"></i></sup>：</label>
	<input type="text" class="form-control" name="username" id="username" value=""  />
  </div>
  {if $jointype == 1||$isvo == 1||$strUser[isvo] == 1}
  <div class="form-group">
    <label>身份证号（或护照号等）<sup><i class="fa fa-asterisk" style="color:red"></i></sup>：</label>

    <input type="text"  class="form-control" name="idcard" id="idcard" value="{$strUser[idcard]}"  />
  </div>
  {/if}
  <div class="form-group">
    <label>性别：</label>
<input {if $strUser['sex']=='男'}checked="select"{/if} name="sex" type="radio" value="男" />男
<input {if $strUser['sex']=='女'}checked="select"{/if} name="sex" type="radio" value="女" />女
  </div>
  <div class="form-group">
    <label>生日：</label>
  <input class="form-control" id="birth" name="birth" readonly value=""  >
  </div>

  <div class="form-group">
    <label>电话<sup><i class="fa fa-asterisk" style="color:red"></i></sup>：</label>

	<input type="phone"  class="form-control" name="phone" id="phone" value="{$strUser[phone]}"  />
  </div>

  <div class="form-group">
    <label>常住地：</label><i class="fa fa-asterisk" style="color:red"></i></sup>：</label>

    <div id="city_3">
      <p><select name="province" class="prov form-control"></select></p>
      <p><select name="city" class="city form-control" disabled="disabled"></select></p>
    </div>

  </div>

  <div class="form-group">
    <label>身份：</label>
    <select id='comefrom' name="comefrom" class="form-control">
      <option value=""></option>
      <option value="1" {if $strUser['comefrom']==1}selected{/if}>自由职业</option>
      <option value="2" {if $strUser['comefrom']==2}selected{/if}>退休人士</option>
      <option value="3" {if $strUser['comefrom']==3}selected{/if}>在职人士</option>
      <option value="4" {if $strUser['comefrom']==4}selected{/if}>在校学生</option>
    </select>
  </div>


  <div class="form-group">
    <label>所属组织<sup><i class="fa fa-asterisk" style="color:red"></i></sup>：</label>
    <select id='orgid' name="orgid" class="form-control">
      <option value=""></option>

      {loop $arrOrg $key $item}
      <option value="{$item['orgid']}" {if $strUser['orgid']==$item['orgid']}selected{/if}>{$item['orgname']}</option>
      {/loop}
      <option value="1000">不在选项中</option>
    </select>
  </div>


  <div class="form-group">
    <label>技能：</label>
    <br><input {if substr_count($strUser['skill'],'1')>0}checked{/if} type="checkbox" name="skill[]" value="1" />组织管理或商务
    <br><input {if substr_count($strUser['skill'],'2')>0}checked{/if} type="checkbox" name="skill[]" value="2" />音乐或舞台艺术
    <br><input {if substr_count($strUser['skill'],'3')>0}checked{/if} type="checkbox" name="skill[]" value="3" />绘画、设计或摄影
    <br><input {if substr_count($strUser['skill'],'4')>0}checked{/if} type="checkbox" name="skill[]" value="4" />编程或工程技术
    <br><input {if substr_count($strUser['skill'],'4')>0}checked{/if} type="checkbox" name="skill[]" value="5" />采编和写作
  </div>


  <div class="form-group">
    <label>可担任{if $jointype==1}馆长{else}理事{/if}：</label>
    <input {if $lishi=='1'}checked{/if} name="leadership" type="checkbox" value="{if $jointype==1}1{else}2{/if}" />
  </div>

  <div class="form-group">
    <label>如何知道微澜的<sup><i class="fa fa-asterisk" style="color:red"></i></sup>：</label>
    <textarea class="form-control" rows="2" name="how" id="how">{$strUser[how]}</textarea>
  </div>
  <div class="form-group">
    <label>自我介绍<sup><i class="fa fa-asterisk" style="color:red"></i></sup>：</label>
	<textarea class="form-control" rows="5" id="about" name="about">{$strUser[about]}</textarea>
  </div>
  


<input type="hidden" name="token" value="{$_SESSION['token']}" />
<button class="btn btn-success" type="submit">提交</button>
</form>

  
  </div>
  <div class="col-md-4"></div>

</div>


</div>
</div>
</div>


</div>
</div>


<div id="protocol" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true"  style="overflow:scroll;">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h5 class="modal-title">馆员报名须知</h5>
      </div>
      <div class="modal-body" >

          <div class="form-group">
            {$strTopic['content']}
          </div>

        <div class="form-group">
          <center><a class="btn btn-default" onclick="closeit()" >我知道了</a></center>
        </div>

    </div>
  </div>
</div>
</div>

<div id="protocol1" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true"   style="overflow:scroll;">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h5 class="modal-title">馆东报名须知</h5>
      </div>
      <div class="modal-body" >

        <div class="form-group">
          {$strTopic1['content']}
        </div>

        <div class="form-group">
          <center><a class="btn btn-default" onclick="closeit1()" >我知道了</a></center>
        </div>

      </div>
    </div>
  </div>
</div>


{if $arrGroup['isplace']==2}
  {if $jointype==1}
    <script>
      $('#protocol').modal('show');
    </script>
    {if $arrGroup['weekend']==0}
      <script>
        bootbox.alert('本馆与学校的作息同步，仅在非寒暑假的工作日开放，请知悉！');
      </script>
    {/if}
  {else}
    <script>
      $('#protocol1').modal('show');
    </script>
  {/if}
{/if}


  <script>
    $(function(e){
      $('#form1').on('submit', function(e) {
        var username  = $('#username').val();
        var idcard = $('#idcard').val();
        var phone  = $('#phone').val();
        var comefrom = $('#comefrom').val();
        var orgid = $('#orgid').val();
        var how = $('#how').val();
        var about = $('#about').val();
        var jointype = $('#jointype').val();
        var isvo = $('#isvo').val();
        var isvo1 = {$strUser['isvo']};

        if(username==''){
          bootbox.alert('姓名必填');
          return false;
        }

        if(jointype==1||isvo==1||isvo1==1){
          if(idcard==''){
            bootbox.alert('身份证号或护照号必填');
            return false;
          }
        }


        if(phone==''){
          bootbox.alert('手机号必填');
          return false;
        }

        if(comefrom==''){
          bootbox.alert('身份必填');
          return false;
        }



        if(orgid==''){
          bootbox.alert('所属组织不能为空，如果你不是由企业或社团介绍来的，或者选项中没有介绍你来的企业或社团，可以选择不在选项中');
          return false;
        }

        if(how==''){
          bootbox.alert('请说出你从哪儿知道微澜的');
          return false;
        }

        if(about==''){
          bootbox.alert('请介绍一下你自己');
          return false;
        }

      });

    });

    function closeit(){
      $('#protocol').modal('hide');
    }
    function closeit1(){
      $('#protocol1').modal('hide');
    }
    $('#birth').datetimepicker({
      language:  'zh-CN',
      format: 'yyyy-mm-dd',
      autoclose: true,
      minView:2
    });
  </script>
{template footer}